/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.agenda.model.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Ronildo
 */
@Embeddable
public class AmTbMediPlanSaudPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "CD_PLAN_SAUD")
    private int cdPlanSaud;
    @Basic(optional = false)
    @NotNull
    @Column(name = "CD_MEDI")
    private int cdMedi;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DT_INIC_VIGE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dtInicVige;

    public AmTbMediPlanSaudPK() {
    }

    public AmTbMediPlanSaudPK(int cdPlanSaud, int cdMedi, Date dtInicVige) {
        this.cdPlanSaud = cdPlanSaud;
        this.cdMedi = cdMedi;
        this.dtInicVige = dtInicVige;
    }

    public int getCdPlanSaud() {
        return cdPlanSaud;
    }

    public void setCdPlanSaud(int cdPlanSaud) {
        this.cdPlanSaud = cdPlanSaud;
    }

    public int getCdMedi() {
        return cdMedi;
    }

    public void setCdMedi(int cdMedi) {
        this.cdMedi = cdMedi;
    }

    public Date getDtInicVige() {
        return dtInicVige;
    }

    public void setDtInicVige(Date dtInicVige) {
        this.dtInicVige = dtInicVige;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) cdPlanSaud;
        hash += (int) cdMedi;
        hash += (dtInicVige != null ? dtInicVige.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AmTbMediPlanSaudPK)) {
            return false;
        }
        AmTbMediPlanSaudPK other = (AmTbMediPlanSaudPK) object;
        if (this.cdPlanSaud != other.cdPlanSaud) {
            return false;
        }
        if (this.cdMedi != other.cdMedi) {
            return false;
        }
        if ((this.dtInicVige == null && other.dtInicVige != null) || (this.dtInicVige != null && !this.dtInicVige.equals(other.dtInicVige))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.agenda.model.entity.AmTbMediPlanSaudPK[ cdPlanSaud=" + cdPlanSaud + ", cdMedi=" + cdMedi + ", dtInicVige=" + dtInicVige + " ]";
    }
    
}
